All Packages Class Hierarchy This Package Previous Next Index
Class java.naming.directory.SearchConstraints
java.lang.Object
|
+----java.naming.directory.SearchConstraints
- public class SearchConstraints
- extends Object
The SearchConstraints class encapsultes
factors that determine scope of search and what gets returned
as a result of the search.
-
OBJECT_SCOPE
- Search the named object.
-
ONELEVEL_SCOPE
- Search one level of the named context.
-
SUBTREE_SCOPE
- Search the entire subtree rooted at the named context.
-
SearchConstraints()
- Constructs a search contraints using defaults.
-
SearchConstraints(int, long, int, String[], boolean, boolean)
- Constructs a search contraints using arguments.
-
getCountLimit()
- Retrieves the maximum number of entries that will be returned
as a result of the search.
-
getDerefLinkFlag()
- Determines whether links will be dereferenced during the search.
-
getReturningAttributes()
- Retrieves the attributes that will be returned as part of the search.
-
getReturningObjFlag()
- Determines whether objects will be returned as part of the result.
-
getSearchScope()
- Retrieves the search scope of these constraints.
-
getTimeLimit()
- Retrieves the time limit of these constraints in milliseconds.
-
setCountLimit(long)
- Sets the maximum number of entries to be returned
as a result of the search.
-
setDerefLinkFlag(boolean)
- Enables/disables link dereferencing during the search.
-
setReturningAttributes(String[])
- Specifies the attributes that will be returned as part of the search.
-
setReturningObjFlag(boolean)
- Enables/disables returning objects returned as part of the result.
-
setSearchScope(int)
- Sets the search scope to one of:
OBJECT_SCOPE, ONELEVEL_SCOPE, SUBTREE_SCOPE.
-
setTimeLimit(int)
- Sets the time limit of these constraints in milliseconds.
OBJECT_SCOPE
public static final int OBJECT_SCOPE
- Search the named object.
ONELEVEL_SCOPE
public static final int ONELEVEL_SCOPE
- Search one level of the named context.
SUBTREE_SCOPE
public static final int SUBTREE_SCOPE
- Search the entire subtree rooted at the named context.
SearchConstraints
public SearchConstraints()
- Constructs a search contraints using defaults.
The defaults are:
- search one level
- no maximum return limit for search results
- no time limit for search
- return all attributes associated with objects that satisfy
the search filter.
- do not return named object (return only name and class)
- do not dereference links during search
SearchConstraints
public SearchConstraints(int scope,
long countlim,
int timelim,
String attrs[],
boolean retobj,
boolean deref)
- Constructs a search contraints using arguments.
- Parameters:
- scope - The search scope. One of:
OBJECT_SCOPE, ONELEVEL_SCOPE, SUBTREE_SCOPE.
- timelim - The number of milliseconds to wait before returning.
If 0, wait indefinitely.
- deref - If true, dereference links during search.
- countlim - The maximum number of entries to return. If 0, return
all entries that satisfy filter.
- retobj - If true, return the object bound to the name of the
entry; if false, do not return object.
- attrs - The identifiers of the attributes to return along with
the entry. If null, return all attributes.
getSearchScope
public int getSearchScope()
- Retrieves the search scope of these constraints.
One of OBJECT_SCOPE, ONELEVEL_SCOPE, SUBTREE_SCOPE.
- Returns:
- The search scope of this constraints.
getTimeLimit
public int getTimeLimit()
- Retrieves the time limit of these constraints in milliseconds.
If the value is 0, this means to wait indefinitely.
- Returns:
- The time limit of these constraints in milliseconds.
getDerefLinkFlag
public boolean getDerefLinkFlag()
- Determines whether links will be dereferenced during the search.
- Returns:
- true if links will be dereferenced; false otherwise.
getReturningObjFlag
public boolean getReturningObjFlag()
- Determines whether objects will be returned as part of the result.
- Returns:
- true if objects will be returned; false otherwise.
getCountLimit
public long getCountLimit()
- Retrieves the maximum number of entries that will be returned
as a result of the search. 0 indicates that all entries will be returned.
- Returns:
- The maximum number of entries that will be returned.
getReturningAttributes
public String[] getReturningAttributes()
- Retrieves the attributes that will be returned as part of the search.
A value of null indicates that all attributes will be returned.
- Returns:
- An array of attribute ids identifying the attributes that
will be returned.
setSearchScope
public void setSearchScope(int scope)
- Sets the search scope to one of:
OBJECT_SCOPE, ONELEVEL_SCOPE, SUBTREE_SCOPE.
- Parameters:
- The - search scope of this constraints.
setTimeLimit
public void setTimeLimit(int ms)
- Sets the time limit of these constraints in milliseconds.
If the value is 0, this means to wait indefinitely.
- Parameters:
- The - time limit of these constraints in milliseconds.
setDerefLinkFlag
public void setDerefLinkFlag(boolean on)
- Enables/disables link dereferencing during the search.
- Parameters:
- on - if true links will be dereferenced; if false, not followed.
setReturningObjFlag
public void setReturningObjFlag(boolean on)
- Enables/disables returning objects returned as part of the result.
If disabled, only the name and class of the object is returned.
If enabled, the object will be returned.
- Parameters:
- on - if true, objects will be returned; if false,
objects will not be returned.
setCountLimit
public void setCountLimit(long limit)
- Sets the maximum number of entries to be returned
as a result of the search.
0 indicates no limit: all entries will be returned.
- Parameters:
- limit - The maximum number of entries that will be returned.
setReturningAttributes
public void setReturningAttributes(String attrs[])
- Specifies the attributes that will be returned as part of the search.
null indicates that all attributes will be returned.
- Parameters:
- attrs - An array of attribute ids identifying the attributes that
will be returned.
All Packages Class Hierarchy This Package Previous Next Index